package com.xukang.batch.listener;

import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;

/**
 * @description:
 * @author: xukang
 * @create: 2025-06-23
 */
public class MyJobListener implements JobExecutionListener {
    @Override
    public void beforeJob(JobExecution jobExecution) {
        System.out.println("beforeJob");
        System.out.println("currentThread:" + Thread.currentThread().getId());
        System.out.println("jobExecution:" + jobExecution);
        // 使用参数...
    }

    @Override
    public void afterJob(JobExecution jobExecution) {
        System.out.println("afterJob");
        System.out.println("currentThread:" + Thread.currentThread().getId());
        System.out.println("jobExecution:" + jobExecution);

        // ...
    }
}
